package promote.brozen.netty.bytebuf;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;

/**
 * @author Brozen
 * @date 2020/9/30 2:11 PM
 * @email brozen@qq.com
 */
public class BufAutoExpand {


    public static void main(String[] args) {
        ByteBuf buf = Unpooled.buffer();

        int len = 100;
        byte[] bytes = new byte[len];
        for (int i = 0; i < len; i++) {
            bytes[i] = ((byte) i);
        }

        while (true) {
            buf.writeBytes(bytes);
            System.out.println(buf.toString());
        }

    }



}
